package com.test.spring.aop.annotation;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/27 19:14
 */

@Order(1)
@Aspect
@Component
public class ValidationAspect {

    @Before("com.test.spring.aop.annotation.LoggingAspect.declareJoinPointExpression()")
    public void validateArgs(JoinPoint joinPoint) {
        Object[] args = joinPoint.getArgs();
        System.out.println("validate " + Arrays.toString(args));
    }
}
